cgen: use C99 short fixed array init syntax #20785
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this change, cgen would initialize fixed arrays like this:
This means that large arrays would generate a lot of C code just for initializing the array, and that significantly increased compilation times. C99 allows this short initialization syntax (see C99 6.7.8/21):
Size of v.c before this change: 6,35 MB (6 665 526 bytes)
Size of v.c after this change: 6,11 MB (6 411 950 bytes) (-253 kb)